home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue66 / Construc / DRBOB42.IDL < prev   
Encoding:
Text File  |  2000-12-28  |  1.2 KB  |  78 lines

  1. module DrBob42
  2. {
  3.   interface Rates
  4.   {
  5.     float interest_rate();
  6.   };
  7.  
  8.  
  9.   interface Account
  10.   {
  11.     float balance();
  12.     float get_rates(in Rates myRates);
  13.   };
  14.  
  15.  
  16.   struct AccountError
  17.   {
  18.     float  Balance;
  19.     string ErrorMessage;
  20.   };
  21.  
  22.   exception AccountException
  23.   {
  24.     AccountError Error;
  25.   };
  26.  
  27.  
  28.   interface MyAccount: Account
  29.   {
  30.     void deposit(in float amount);
  31.     void withdraw(in float amount) raises(AccountException);
  32.   };
  33.  
  34.  
  35.   typedef string Identifier;
  36.  
  37.   enum EnumType
  38.   {
  39.     first,
  40.     second,
  41.     third
  42.   };
  43.  
  44.   struct StructType
  45.   {
  46.     short s;
  47.     long l;
  48.     Identifier i;
  49.   };
  50.  
  51.   union UnionType switch (long)
  52.   {
  53.     case -1: short s;
  54.     case  0: long l;
  55.     case  1: Identifier i;
  56.   };
  57.  
  58.   const unsigned long ArraySize = 3;
  59.  
  60.   typedef StructType StructArray[ArraySize];
  61.  
  62.   typedef sequence<StructType> StructSequence;
  63.  
  64.   interface ADT
  65.   {
  66.     void test(in Identifier one, in EnumType two, in StructType three,
  67.       in UnionType four, in StructArray five, in StructSequence six);
  68.   };
  69.  
  70.   typedef sequence<unsigned long, 5> IntSeq;
  71.  
  72.   interface SeqAccount
  73.   {
  74.     float balance(in IntSeq mySeq);
  75.   };
  76.  
  77. };
  78.